package com.bwhx.eruler.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.bwhx.eruler.bean.Notice;
import com.bwhx.eruler.bean.Page;
import com.bwhx.eruler.dao.NoticeDao;

/**
 * @Description:
 */
@Repository
public class NoticeDaoImpl extends BaseDaoImpl<Notice> implements NoticeDao {
	public NoticeDaoImpl() {
		this.setNs("com.bwhx.eruler.mapper.NoticeMapper.");
	}
	@Override
	public List<Notice> list(Page p) {
		
		return getSqlSession().selectList(this.getNs() + "list", p);
	}


	@Override
	public Integer count(Notice n) {
		
		return getSqlSession().selectOne(this.getNs() + "count", n);
	}
/*
	public List<User> findByName(String username) {
	
		return getSqlSession().selectList("com.bwhx.eruler.mapper.UserMapper." + "findByName", username);
	}


	@Override
	public List<User> findByMoblie(String mobile) {
		return getSqlSession().selectList("com.bwhx.eruler.mapper.UserMapper." + "findByMoblie", mobile);
	}


	@Override
	public void updateByMobile(User user) {
		this.getSqlSession().update("com.bwhx.eruler.mapper.UserMapper." + "updateByMobile", user);
		
	}


	@Override
	public User find(Integer id) {
		// TODO Auto-generated method stub
		return getSqlSession().selectOne("com.bwhx.eruler.mapper.UserMapper." + "findById", id);
	}
*/
	@Override
	public void del(String nId) {
		getSqlSession().delete(this.getNs() + "del", nId);
		
	}
}
